#include <cassert>
#include "Character.h"

using namespace std;

Character::Character(int pMaxHP, int pSpeed) {
    assert(pMaxHP > 0);
    assert(pSpeed > 0); //perhaps this should have an upper bound :)
    mMaxHP = pMaxHP;
    mCurrentHP = mMaxHP; //assuming that initial HP will be max'ed
    mSpeed = pSpeed;
}

Character::~Character() {
    /* delete weapons and whatnot */
    /* also do we need to call/redo the baseclass dtor
       since we defined a new here? (baseclass dtor is
       virtual) */       
}

void Character::dispose() {
    //delete this?
    return;
}

void Character::setCurrentHP(int pCurrHP) {
    assert(pCurrHP > 0);    
    if(mCurrentHP > mMaxHP)
        mCurrentHP = mMaxHP;
    else
        mCurrentHP = pCurrHP;

}

int Character::getCurrentHP() const {
    return mCurrentHP;
}

void Character::setMaxHP(int pMaxHP) {
    assert(pMaxHP > 0);
    mMaxHP = pMaxHP;

    if(mCurrentHP > mMaxHP)
        mCurrentHP = mMaxHP;            
}

int Character::getMaxHP() const {
    return mMaxHP;
}

void Character::setSpeed(int pSpeed) {
    assert(pSpeed > 0); //TODO: maybe an upper bound here?
    mSpeed = pSpeed;
}

int Character::getSpeed() const {
    return mSpeed;        
}

